
import time
import datetime

a = time.strftime("%Y-%m-%d %H:%M:%S")

print(a)




current_time = datetime.datetime.now()
time_delta = datetime.timedelta(days=18, minutes=30, seconds=10) #这里的参数分表表示 天数上相差18，分钟上相差30min，秒数上相差10s
time_result = (current_time - time_delta).strftime("%Y-%m-%d %H:%M:%S")


print("现在的时间：", current_time, "\n想达到的时间差：", time_delta, "\n结果时间：", time_result)


"""
1. python 判断当前时间是否在一个时间范围内 https://blog.csdn.net/qq_21570029/article/details/83185168


"""